﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace homework1_2_calculator
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void textBox2_TextChanged(object sender, EventArgs e)
        {

        }

        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {

        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {

        }

        private void btn_Click(object sender, EventArgs e)
        {
            double a = double.Parse(input1.Text);
            double b = double.Parse(input2.Text);
            double d = 0;
            string c = sign.Text;
            switch (c) {
                case "+":
                    d = a + b;
                    break;
                case "-":
                    d = a - b;
                    break;
                case "*":
                    d = a *b;
                    break;
                case "/":
                    d = a / b;
                    break;
            }
            this.result.Text = d.ToString();

        }
    }
}
